import {request} from '@umijs/max';
import * as API from "@/services";


/** 发货记录 分页检索请求 */
export async function queryShippingRecords(params: API.ShippingRecordPageQueryParams): Promise<API.RespPageResult<API.ShippingRecord>> {
  return request('/api/v1/shipping-record', {
    params,
  });
}

/** 发货记录 详情请求 */
export async function queryShippingRecord(bizId: API.EntityId): Promise<API.RespResult<API.ShippingRecord>> {
  return request(`/api/v1/shipping-record/${bizId}`);
}

/** 发货记录 创建请求 */
export async function createShippingRecord(entity: API.ShippingRecord_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/shipping-record`, {
    method: 'POST',
    data: entity,
  });
}

/** 发货记录 修改请求 */
export async function modifyShippingRecord(entity: API.ShippingRecord_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/shipping-record/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 发货记录 修改(部分)请求 */
export async function patchShippingRecord(entity: API.ShippingRecord_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/shipping-record/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 发货记录 删除请求 */
export async function deleteShippingRecord(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/shipping-record/${bizId}`, {
    method: 'DELETE',
  });
}

/** 发货记录 批量删除请求 */
export async function deleteShippingRecords(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/shipping-record`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
